package com.plpm.dto;

/**
 * 文件下载结果
 * 用于服务层内部传递下载文件的结果信息
 *
 * @author PLPM Team
 * @version 1.0
 */
public class FileDownloadResult {
    private final String localFilePath;
    private final String fileName;
    private final String fileHash;      // 文件hash值（从响应头获取）
    private final String actualHash;    // 实际计算的hash值
    private final long fileSize;
    private final boolean hashValid;    // hash验证结果

    public FileDownloadResult(String localFilePath, String fileName, String fileHash, String actualHash, long fileSize, boolean hashValid) {
        this.localFilePath = localFilePath;
        this.fileName = fileName;
        this.fileHash = fileHash;
        this.actualHash = actualHash;
        this.fileSize = fileSize;
        this.hashValid = hashValid;
    }

    // 兼容旧构造方法
    public FileDownloadResult(String localFilePath, String fileName, String fileHash, long fileSize) {
        this(localFilePath, fileName, fileHash, null, fileSize, false);
    }

    public String getLocalFilePath() {
        return localFilePath;
    }

    public String getFileName() {
        return fileName;
    }

    public String getFileHash() {
        return fileHash;
    }

    public String getActualHash() {
        return actualHash;
    }

    public long getFileSize() {
        return fileSize;
    }

    public boolean isHashValid() {
        return hashValid;
    }
}

